package org.rency.crawler.fetch.handler.impl;

import org.rency.crawler.common.exception.CrawlerException;
import org.rency.crawler.domain.state.FetchStatus;
import org.rency.crawler.fetch.handler.AbstractFetchHandler;
import org.rency.crawler.fetch.helper.FetchCarrier;
import org.springframework.stereotype.Component;

/**
 * 描述: ${TODO}<br>
 * 最近修改时间:2017/11/22 11:22<br>
 *
 * @author CaiyuRen
 * @version V1.0
 * @since 2017/11/22 11:22
 */
@Component
public class FetchBeforeHandler extends AbstractFetchHandler {

  @Override
  protected String getHandlerName() {
    return "抓取前置";
  }

  @Override
  protected void onHandler(FetchCarrier carrier) throws CrawlerException {
    logger.debug("准备抓取:{}.",carrier.getLogPrefix());
    carrier.getFetchState().setFsStatus(FetchStatus.SUCCESS);
  }
}
